package exception;

import java.io.FileNotFoundException;

public class ThrowDemo {
    public static void main(String[] args){
        Student zs=new Student();
        try {
            zs.setAge(1000);
        } catch (IllegalAgeException e) {
            e.printStackTrace();
        }
        System.out.println("此人的年龄为"+zs.getAge()+"岁");


            String line=null;
        System.out.println(line.length());
        line ="";
        System.out.println(line.charAt(0));
        line="abc";
        System.out.println(Integer.parseInt(line));






        /*
        Student zs=new Student();
        try {
            zs.setAge(1000);
            System.out.println("此人的年龄为"+zs.getAge()+"岁");
        }catch(Exception e){
            System.out.println("年龄不合法");
        }

         */
    }
}
